/*
 * @(#)Xfsl.java        1.0 2000/05/09
 *
 * This file is part of Xfuzzy 3.0, a design environment for fuzzy logic
 * based systems.
 *
 * (c) 2000 IMSE-CNM. The authors may be contacted by the email address:
 *                    xfuzzy-team@imse.cnm.es
 *
 * Xfuzzy is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation.
 *
 * Xfuzzy is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * for more details.
 */

package xfuzzy.xfdm.view.listener;

import xfuzzy.xfdm.view.Xfdm;
import java.awt.event.*;

/**
 * Controlador de eventos de los botones
 * 
 * @author Francisco Jos� Moreno Velo
 *
 */
public class XfdmActionListener implements ActionListener {

	//----------------------------------------------------------------------------//
	//                            MIEMBROS PRIVADOS                               //
	//----------------------------------------------------------------------------//

	/**
	 * Ventana principal de la herramienta xfdm
	 */
	private Xfdm frame;

	//----------------------------------------------------------------------------//
	//                                CONSTRUCTOR                                 //
	//----------------------------------------------------------------------------//

	/**
	 * Constructor
	 */
	public XfdmActionListener(Xfdm frame) {
		this.frame = frame;
	}

	//----------------------------------------------------------------------------//
	//                             M�TODOS P�BLICOS                               //
	//----------------------------------------------------------------------------//
	
	/**
	 * Interfaz ActionListener
	 */
	public void actionPerformed(ActionEvent e) {
		String command = e.getActionCommand();
		if(command.equals("Algorithm")) frame.actionAlgorithm();
		else if(command.equals("Flat")) frame.actionFlat();
		else if(command.equals("FuzzyID3")) frame.actionFuzzyID3();
		else if(command.equals("FuzzConRI")) frame.actionFuzzConRI();
		else if(command.equals("FuzzyCN2")) frame.actionFuzzyCN2();
		else if(command.equals("Wang")) frame.actionWang();
		else if(command.equals("Nauck")) frame.actionNauck();
		else if(command.equals("Senhadji")) frame.actionSenhadji();
		else if(command.equals("IncGrid")) frame.actionIncGrid();
		else if(command.equals("IncCluster")) frame.actionIncCluster();
		else if(command.equals("FixedCluster")) frame.actionFixedCluster();
		else if(command.equals("DataSet")) frame.actionDataSet();
		else if(command.equals("Test")) frame.actionDataTest();
		else if(command.equals("Log")) frame.actionLog();
		else if(command.equals("Inputs")) frame.actionInputs();
		else if(command.equals("System")) frame.actionSystem();
		else if(command.equals("Load")) frame.actionLoad();
		else if(command.equals("Save")) frame.actionSave();
		else if(command.equals("Create")) frame.actionCreate();
		else if(command.equals("Close")) frame.close();
	}

}
